package hang.study.uistudy;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Created by hang on 2015-9-20.
 */
public class TestListViewActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test_listview_layout);

        ListView listView1 = (ListView)findViewById(R.id.listView1);
        String[] arr1 = {"孙悟空","猪八戒","杀阵","唐正"};
        ArrayAdapter<String> adapter1 = new ArrayAdapter<>(this,R.layout.list_item,arr1);
        listView1.setAdapter(adapter1);

        ListView listView2 = (ListView)findViewById(R.id.listView2);
        String[] arr2 = {"Java","C#","C++","Python","PHP"};
        ArrayAdapter<String> adapter2 = new ArrayAdapter<>(this,R.layout.list_item2,arr2);
        listView2.setAdapter(adapter2);

    }
}
